import request from "@/utils/request";
import {spliceUrlParams} from "@/utils/dataUtil";

export const queryMusicList = (page, size, params)=>{
    return request.get(
        `api/doc/music/${page}/${size}/list/ext`,
        params,
    )
}
export const addMusic = (params) => {
    return request.post(
        `api/doc/music/add`,params
    )
}
export const addMusicNum = (musicId,type) => {
    return request.post(
        `api/doc/music/add/${type}/num/${musicId}/ext`,{}
    )
}

export const getMusicInfo = (id)=>{
    return request.get(
        `api/doc/music/${id}/info/ext`,
    )
}

export const getMusicHistory = (type)=>{
    return request.get(
        `api/doc/music/my/history`,{type}
    )
}

export const addLoveMusic = (params)=>{
    return request.post(
        `api/doc/music/add/love`,params
    )
}

export const downloadFile = (fileId) => {
    return request.down(
     `api/doc/file/${fileId}/download`,
    )
}

export const updateMusic = (params) => {
    return request.put(
        `api/doc/music/update`,params
    )
}

export const addComment = (params) => {
    return request.post('api/doc/comment/add',params);
}
export const queryComment = (page,size,params) => {
    return request.get(`api/doc/comment/${page}/${size}/list`,params);
}
export const deleteComment = (id) => {
    return request.post(`api/doc/comment/${id}/delete`);
}

export const addLikeComment = (params) =>{
    return request.post('api/doc/comment/like',params)
}